package com.wlhse.dao;

import com.wlhse.dto.getDto.ChangQinEmployeeDto;
import com.wlhse.dto.inDto.*;
import com.wlhse.dto.outDto.*;
import com.wlhse.entity.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CheckRecordDao {
    //我验证的问题
    List<CheckRecordPojo> getCheckRecordMine(CheckRecordInDto checkRecordInDto);

    int getCheckRecordMineCount(CheckRecordInDto checkRecordInDto);
    //我验证的子问题
    List<CheckRecordRectRecord> getCheckRecordMineChild(CheckRecordInDto checkRecordInDto);

    int getCheckRecordMineChildCount(CheckRecordInDto checkRecordInDto);

    //我验证的问题按id查询
    List<CheckRecordRectRecord> getCheckRecordMineByID(@Param("checkRecordID") int id,@Param("url") String url);

    //我整改的问题
    List<CheckRecordPojo> getCheckRecordMineReci(CheckRecordInDto checkRecordInDto);

    int getCheckRecordMineReciCount(CheckRecordInDto checkRecordInDto);

    //我整改的子问题
    List<CheckRecordRectRecord> getCheckRecordMineReciChild(CheckRecordInDto checkRecordInDto);

    int getCheckRecordMineReciChildCount(CheckRecordInDto checkRecordInDto);

    int getCheckRecordMineReciChildCount2(CheckRecordInDto checkRecordInDto);

    //当前登陆人的checkrecord
    List<RectRecordPojo> getCurrentCheckRecord(Integer id);

    List<CheckRecordPojo> getCheckRecordByCondition(CheckRecordInDto checkRecordInDto);

    List<CheckRecordPojo> queryCheckRecordByCondition(CheckRecordQueryInDto checkRecordQueryInDto);

    List<CheckRecordPojo> queryCheckRecordChildByCondition(CheckRecordQueryInDto checkRecordQueryInDto);

    int getCheckRecordByConditionCount(CheckRecordInDto checkRecordInDto);

    int queryCheckRecordByConditionCount(CheckRecordQueryInDto checkRecordQueryInDto);

    int queryCheckRecordChildByConditionCount(CheckRecordQueryInDto checkRecordQueryInDto);

    //SupervisionTaskCode
    List<SupervisionTaskPojo> getSupervisionTaskCode(@Param("round") int round);

    int deleteCheckRecord(int id);

    //根据id查询检查记录
    CheckRecordPojo getCheckRecordById(@Param("checkRecordID") int id,@Param("url") String url);

    //更新验证数据
    int updateCheckRecord(CheckRecordVerifyInDto checkRecordVerifyInDto);

    //根据验证人name查询id
    int getEmplCode(@Param("name") String name);
    //根据id查name
    String getEmplName(@Param("id") Integer id);

    //更新整改数据
    int updateCheckRecordReci(CheckRecordReciInDto checkRecordReciInDto);

    //长庆员工模糊查询
    List<ChangQinEmployeeDto> selectEmployee(@Param("name") String name);

    int selectEmployeeCount(@Param("name") String name);

    //superVisionGroupMember模糊查询
    List<SuperVisionGroupMemberOutDto> selectSuperVisionGroupMember(@Param("name") String name);

    int selectSuperVisionGroupMemberCount(@Param("name") String name);

    int getMaxLengthCompanyCode();

    //条件查询子节点---我待整改---我待验证
    List<CheckRecordPojo> getchildCrByCondition(CheckRecordInDto checkRecordInDto);
    int getchildCrByConditionCount(CheckRecordInDto checkRecordInDto);

    //当前登陆人暂存问题条件查询
    List<CheckRecordTemporarySaveOutDto> getCrTemporarySave(CheckRecordTemporarySaveInDto checkRecordInDto);
    int getCrTemporarySaveCount(CheckRecordTemporarySaveInDto checkRecordInDto);

    //当前登陆人暂存子问题问题条件查询
    List<CheckRecordTemporarySaveOutDto> getchildCrTemporarySave(CheckRecordTemporarySaveInDto checkRecordInDto);
    int getchildCrTemporarySaveCount(CheckRecordTemporarySaveInDto checkRecordInDto);

    //新增整改记录表
    int addRectRecord(RectRecordPojo rectRecordPojo);

    //查找指定监管责任人ID的整改记录@Param("supervisorID") Integer supervisorID,
    List<RectRecordPojo> getOneRectRecord(@Param("checkrecordID") Integer checkrecordID);

    //更新RectRecord的status
    int updateRectRecord(RectRecordPojo rectRecordPojo);

    //更新RectRecord的其他数据
    int updateRectRecord2(RectRecordPojo rectRecordPojo);

    //checkrecord和整改记录一起查询
    List<CheckRecordRectRecord> queryCheckRecordsByCondition(CheckRecordQueryInDto checkRecordQueryInDto);

    List<CheckRecordRectRecord> queryCheckRecordsChildByCondition(CheckRecordQueryInDto checkRecordQueryInDto);
    List<CheckRecordRectRecord> queryCheckRecordsChildByCondition2(CheckRecordQueryInDto checkRecordQueryInDto);
    EmployeePojo queryStation(Integer id);
    List<CheckRecordRectRecord> queryMyCheckRecordsChildByCondition(CheckRecordQueryInDto checkRecordQueryInDto);

    int queryCheckRecordsByConditionCount(CheckRecordQueryInDto checkRecordQueryInDto);

    int queryCheckRecordsChildByConditionCount(CheckRecordQueryInDto checkRecordQueryInDto);
    int queryCheckRecordsChildByConditionCount2(CheckRecordQueryInDto checkRecordQueryInDto);

    int queryMyCheckRecordsChildByConditionCount(CheckRecordQueryInDto checkRecordQueryInDto);

    //查询category1
    CompanyPojo getCompanyByCode(@Param(value="companyCode") String companyCode);

    //删除整改记录
    int deleteRectRecord(Integer id);

    //我待整改的问题子节点和指定节点
//    List<CheckRecordPojo> getWillReciCrMine(CheckRecordInDto checkRecordInDto);
//    int getWillReciCrMineCount(CheckRecordInDto checkRecordInDto);
//    List<CheckRecordPojo> getWillReciCrMineChild(CheckRecordInDto checkRecordInDto);
//    int getWillReciCrMineChildCount(CheckRecordInDto checkRecordInDto);


    String getCurrentCompany(Integer employeeID);

    //这个接口有问题，别用
    String getRoleCode(Integer id);

    //返回list的rolecode
    List<String> getRoleCodes(Integer id);
    List<String> getRoleCodess(Integer id);

    List<HazardFactorsOutDto> getHazardFactors();

    int updateVerifyPerson(CheckRecordVerifyInDto2 checkRecordVerifyInDto);

//    清空整改记录
    Integer cleanCheckRecord(@Param("id") Integer id);

    List<RectRecordOutDto> queryRectRecord(@Param("id") Integer id);

}